#!/bin/bash
echo "启动mysql服务"
/etc/init.d/mysql restart
echo "设置root用户远程登录权限"
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;"
echo "设置root密码"
mysql -e "set password for root@127.0.0.1=password('root');"
